package itsm.isperp.workflow.graph;

/**
 * 
 * 
 * @author lizx
 * @date 2013-4-24
 */
public class DivShape extends Shape {

	private int zIndex;
	private String id;
	private String type;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public DivShape(String name, float x, float y, float w, float h) {
		super(name, x, y, w, h);
		zIndex = 0;
		id = "";
		type = "";
	}

	public DivShape(String name, float x, float y, float w, float h,
			int zIndex, String id, String type) {
		super(name, x, y, w, h);
		this.zIndex = 0;
		this.id = "";
		this.type = "";
		this.zIndex = zIndex;
		this.id = id;
		this.type = type;
	}

	public int getzIndex() {
		return zIndex;
	}

	public void setzIndex(int zIndex) {
		this.zIndex = zIndex;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String toString() {
		return (new StringBuilder()).append("<div class='flowNode' id='")
				.append(id).append("' ")
				.append("style='position:absolute;z-index:").append(zIndex)
				.append("; ").append("left:").append(getX()).append("px;")
				.append("top:").append(getY()).append("px;").append("width:")
				.append(getW()).append("px;").append("height:").append(getH())
				.append("px;' ").append("title='").append(getName())
				.append("' ").append("type='").append(getType())
				.append("'></div>\r\n".replaceAll("\\.0px", "px")).toString();
	}

}
